<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="com.kylin.module.shop.orm.*,
				 com.kylin.common.dict.orm.Dict,
				 com.kylin.module.user.orm.*" %>
<%@ include file="../_deco/managetop.jsp"%>

<br>
<table class="tl050804" cellspacing="0" cellpadding="0">
  <tr>
    <td width="280"  align="center" valign="top">
			<%@ include file="../_deco/manageLeft.jsp"%>
		</td>
		<td align="left" valign="top">
<%
////////////////////右侧 内容区  /////////////////////// start
%>		

<%    
	Company currCom = (Company)session.getAttribute(Constants.CURR_LANG_COMPANY);
%>
<table width="92%" cellspacing="0" cellpadding="0">
      <tr>
        <td height="30" class="ms02">&nbsp;&nbsp;<bean:message key="company.29"/></td>
        <td align="right">欢迎</td>
      </tr>
	   <tr>
              <td colspan="2" bgcolor="CDCDCD" height="1"></td>
             
	   </tr>
    </table>
<br>
<mytag:MyActionMsg />
<html:form action="/module/shop/company/manageProduct.do?CMD=add" enctype="multipart/form-data">
<input type="hidden" name="company" value="<%=currCom.getId()%>">
<table width="90%" border="0" cellspacing="0" cellpadding="0">
	<tr align="left">
		<td width="80" height="30">
			<b><bean:message key="company.30"/>：</b>
		</td>
		<td>
			<input name="name" type="text" size="40" check="^\S+$" warning="请输入产品名称"><font color="red">*</font>
		</td>
	</tr>
	<tr align="left">
		<td height="30">
			<b><bean:message key="company.31"/>：</b>
		</td>
		<td>
              <%
    			  List maincatproduct = MemObjFactory.getDict(dict_catProducts,sessionLocale.toString());
                  StringBuffer sb1 = new StringBuffer();
                  StringBuffer sb2 = new StringBuffer();
                  if(maincatproduct != null)
                  for(int i=0;i<maincatproduct.size();i++){
                  	  Dict dict = (Dict)maincatproduct.get(i);
                      if(dict.getParent() == null){
                      	 if(sb1.length() > 1)
                      	     sb1.append(",");
                         sb1.append("\n  new SubSelectObj('").append(dict.getId()).append("','");
                         sb1.append("").append("','");
                         sb1.append(dict.getName()).append("')");
                      }else{
                      	 if(sb2.length() > 1)
                      	     sb2.append(",");
                         sb2.append("\n  new SubSelectObj('").append(dict.getId()).append("','");
                         sb2.append(dict.getParent().getId()).append("','");
                         sb2.append(dict.getName()).append("')");
                      }
                  }
              %>
       <select name="catproduct" id="catproduct" onchange="checkCascadSelect(this)" check="^\S+$" warning="请选择产品分类">
       <option>-- <bean:message key="company.77"/> --</option>
       </select>
       <script src="/script/kylin.js"></script>
       <script>
		var parentArray1= new Array(<%=sb1%>); 
		var subArray1= new Array(<%=sb2%>); 
		setCascadSelect(parentArray1,subArray1,document.getElementById("catproduct"));
       </script>       
		</td>
	</tr>
	<tr align="left">
		<td height="30">
			<b><bean:message key="base.63"/>：</b>
		</td>
		<td>
			<input name="quantity" type="text" size="10" check="^\S+$" warning="请输入产品数量">
			<mytag:select name="unit" dictName="计量单位"/><font color="red">*</font>
			
		</td>
	</tr>
<% try{ %>
	<tr align="left">
		<td height="30">
			<b><bean:message key="company.32"/>：</b>
		</td>
		<td>
			<input name="price" type="text" size="10" check="^\S+$" warning="请输入产品价格">
			<mytag:select name="currency" dictName="币种"/><font color="red">*</font>
			
		</td>
	</tr> 
	<%  }catch(Exception e){} %>
	<tr align="left">
		<td height="30">
			<b><bean:message key="company.33"/>：</b>
		</td>
		<td>
			<textarea name="introduce" cols="50" rows="8"></textarea>
		</td>
	</tr>
	<tr align="left">
		<td height="30">
			<b><bean:message key="base.62"/>：</b>
		</td>
		<td>
			<input name="imgFile" type="file" size="40">
		</td>
	</tr>
	<tr align="center">
		<td height="50" colspan="2">
			<input type="submit" name="Submit" value="<bean:message key="base.71"/>">
		</td>
	</tr>
</table>
</html:form>

<%
////////////////////右侧 内容区  /////////////////////// end
%>		
		</td>
	</tr>
</table>


